{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "fig,ax1 = plt .subplots()\n",
    "t = np.arange(0.01,10.0,0.01 )\n",
    "s1 = np.exp(t)\n",
    "ax1.plot(t, s1, 'b-')\n",
    "ax1.set_xlabel('time(s)')\n",
    "# Make the y-axis label and tick labels match the line color.\n",
    "ax1.set_ylabel( 'exp', color = 'b' )\n",
    "for tl in ax1.get_yticklabels():\n",
    "    tl .set_color('b')\n",
    "    \n",
    "    \n",
    "ax2 = ax1.twinx()\n",
    "s2 = np.sin(2*np.pi*t)\n",
    "ax2.plot(t, s2, 'r.')\n",
    "ax2.set_ylabel( 'sin', color = 'r')\n",
    "for tl in ax2.get_yticklabels():\n",
    "    tl .set_color( 'r')`\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
